| Index
» Projekty
» phpMyEdit
» Fórum
» Setting Column Widths |
 |
DeltaDave
Založený: 31.12.2010
Príspevky: 6
Zaslal: 2010-12-31 00:28
Návrat hore
Odpovedať s citátom
|
I have looked through the forum but have not found a definitive method that seems to work to define a columns width.
I have tried
| Kód: |
| $opts['fdd']['column_name']['width'] = 'Xpx'; |
and also
| Kód: |
$opts['fdd']['column_name'] = array(
'name' => 'Name',
'select' => 'T',
'maxlen' => 255,
'sort' => true,
'colattrs' => width="Xpx"
); |
And I am getting frustrated.
Dave
|
doug
Založený: 10.02.2003
Príspevky: 1013
Bydlisko: Denver, Colorado (USA)
Zaslal: 2011-01-01 14:12
Návrat hore
Odpovedať s citátom
|
Create a style for the column ("company" in the following examples)
http://opensource.platon.sk/projects/doc.php/phpMyEdit/html/configuration.css.html
| Kód: |
$opts['fdd']['company'] = array(
// style name can be any alphabetic string, e.g. company or foobar
'css' => array('postfix' => 'company'),
'default' => '',
'input' => '',
'maxlen' => 30,
'name' => 'Company',
'options' => 'ACPVDFL',
'required' => false,
'select' => 'T',
'size|ACP' => 30,
'sqlw' => 'TRIM("$val_as")',
'sort' => true
); |
In List mode, the following 6 HTML tags (more or less) would appear:
| Kód: |
<a class="pme-header-company"
<input class="pme-filter-company"
<td class="pme-cell-0-company"
<td class="pme-cell-1-company"
<td class="pme-filter-company"
<th class="pme-header-company" |
In other modes (View, Change, Delete) there will exist different and/or new styles. The Web Developer Toolbar for Firefox makes it easier to locate styles on the currently viewed page.
CSS has it's limitations, you can't declare a column width of 25 pixels if the data is wider:
http://www.w3.org/TR/CSS21/propidx.html
Create the CSS you need for a particular style, e.g. if column width is the issue, just style the header TH instead of every single TD tag. If you can control the width in the TH tag, and the results aren't what you expect, then you probably won't gain anything by messing with multiple TD styles.
| Kód: |
th.pme-header-company{
background-color:orange;
border:1px solid black;
color:white;
font:bold 14px "courier new", verdana,helvetica,arial,sans-serif;
text-align:left;
vertical-align:middle;
width: 350px;
} |
|
doug
Založený: 10.02.2003
Príspevky: 1013
Bydlisko: Denver, Colorado (USA)
Zaslal: 2011-01-01 14:19
Návrat hore
Odpovedať s citátom
|
I suppose one might also create a transparent GIF file 1px by 1px and use CONCAT to create a custom 'name' which includes the field name, a <br> tag, and something like <img src="spacer.gif" width="300" height="1"> to force 300 pixel width. Use the forum's Search feature to locate CONCAT examples.
|
DeltaDave
Založený: 31.12.2010
Príspevky: 6
Zaslal: 2011-01-02 22:37
Návrat hore
Odpovedať s citátom
|
[quote="doug"]Create a style for the column ("company" in the following examples)
http://opensource.platon.sk/projects/doc.php/phpMyEdit/html/configuration.css.html
[code]$opts['fdd']['company'] = array(
// style name can be any alphabetic string, e.g. company or foobar
'css' => array('postfix' => 'company'),
Many thanks Doug
Once I had added the postfix css addition using your method then I was able to get my hands on the styles generated and tweak them.
One thing I found - and I don't know if it is peculiar to my setup - was that it wasn't enough to just add width:350px to the style. On its own that didn't work. I had to add display:block as well.
This would probably explain why I wasn't getting anything to work using 'colattrs' => 'width="350px"'
Anyway I have it working now and it seems a reliable method for sizing columns.
Thanks again
David
|
doug
Založený: 10.02.2003
Príspevky: 1013
Bydlisko: Denver, Colorado (USA)
Zaslal: 2011-01-05 14:35
Návrat hore
Odpovedať s citátom
|
'colattrs' may be broken, in general.
For others who might read this thread, 'colattrs' => 'width="350px" should instead be 'colattrs' => 'width="350" as a PX designation would result in an invalid HTML parameter.
|
DeltaDave
Založený: 31.12.2010
Príspevky: 6
Zaslal: 2011-01-09 02:16
Návrat hore
Odpovedať s citátom
|
Thanks for the clarification on the px values when used with colattrs
much appreciated.
David[/quote]
|
|
Odoslať novú tému
Odpovedať na tému
|
|
|
|