Fork me on GitHub

Announcement

The oneye project has been discontinued. You might not expect further fixes and support from us. All community related systems are set to read-only mode. Though feel free to download and use oneye as-is or even fork it over at GitHub.

#1 2011-08-27 22:09:22

losh
Member
Registered: 2011-08-27
Posts: 3

sortableTable and text-align

ENGLISH:
hello!
is it somehow possible to align the (text) content of a sortable table column to the right?

hallo!
ist es rigendwie möglich, in einer sortableTable den (Text-) Inhalt einer spalte rechtsbündig auszurichten?

Offline

#2 2011-09-01 23:26:49

lars-sh
Administrator
From: near Hamburg, Germany
Registered: 2011-07-14
Posts: 731
Website

Re: sortableTable and text-align

ENGLISH:
I guess it's best to do this using css.
Use JavaScript to set a class to the thable widget and write some css just like this:

Ich denke es ist am besten, wenn du dies mit CSS regelst.

Dafür setzt du via JavaScript eine CSS-Klasse für deine Tabelle und kannst dann via CSS z.B. folgendes machen:

.test td + td + td + td {
    text-align: right;
}
.test td + td + td + td + td {
    text-align: left;
}

Best regards,
Lars Knickrehm

The oneye project.

Offline

#3 2011-09-02 03:24:44

matthewtpowell
Member
Registered: 2011-09-01
Posts: 3

Re: sortableTable and text-align

I think you may be looking to do..

.sort-table {
        text-align: right;
}

in the .css ?

Offline

#4 2011-09-02 11:23:00

losh
Member
Registered: 2011-08-27
Posts: 3

Re: sortableTable and text-align

thank you!
because I'm not very familiar with css i need a little more help:

$sorttypes = array('Hidden','Date', 'Char', 'Number', 'String', 'String');
    $theaders = array('ID','Datum', 'Ein/Aus', 'Betrag', 'Text', 'Kategorie');
    $tblBank = new SortableTable(array(
        'name' => 'tblBank',
        'title' => 'Bankbewegungen',
        'father' => 'boxBank',
        'x' => -5,
        'y' => 30,
        'width' => $boxBank->width-10,
        'height' => $boxBank->height-70,
        'cent' => 2,
        'theader' => $theaders,
        'sortypes' => $sorttypes));
    $tblBank->show();

this is my table...i need to align the content of the 4th column ('Betrag').
can i do this by

$tblBank->setcss(...);

?

Last edited by losh (2011-09-02 11:24:08)

Offline

#5 2011-09-02 12:30:11

losh
Member
Registered: 2011-08-27
Posts: 3

Re: sortableTable and text-align

ok, i did this:

$tblBank->setCss(array('text-align' => 'right'));

this aligns every text within the table...but i only need the CONTENT (not header) of ONE COLUMN (not all columns) aligned.

Offline

Board footer

Powered by FluxBB