/    Sign up×
Community /Pin to ProfileBookmark

how to set the TD width ?

I want to make 4,6,9th cell little bigger .How to make it ?

[CODE]<html>
<head>
</head>
<body>
<table width=”100&#37;” border=”1″ align=”center” cellpadding=”0″ cellspacing=”0″>
<tr>
<td width=”25%”>Africa Central</td>
<input type=”hidden” name=”Africa Central” value=”40″>

<td class=cellTextLeft style=”width:20%;”><input type=”checkbox” name=”strCustTerr1″ value=”” align=”middle” /></td>

<td class=cellTextLeft ><input type=”checkbox” name=”strCustTerr2″ value=”” align=”middle” /></td>

<td class=cellTextGreyLeft><input type=”checkbox” name=”strCustTerr3″ value=”” align=”middle” /></td>

<td class=cellTextGreyLeft><input type=”checkbox” name=”strCustTerr4″ value=”” align=”middle” /></td>

<td class=cellTextLeft><input type=”checkbox” name=”strCustTerr5″ value=”” align=”middle” /></td>

<td class=cellTextLeft><input type=”checkbox” name=”strCustTerr6″ value=”” align=”middle” /></td>

<td class=cellTextGreyLeft><input type=”checkbox” name=”strCustTerr7″ value=”” align=”middle” /></td>

<td class=cellTextGreyLeft><input type=”checkbox” name=”strCustTerr8″ value=”” align=”middle” /></td>

<td class=cellTextLeft><input type=”checkbox” name=”strCustTerr9″ value=”” align=”middle” /></td>

<td class=cellTextLeft><input type=”checkbox” name=”strCustTerr10″ value=”” align=”middle” /></td>

<td class=cellTextGreyLeft><input type=”checkbox” name=”strCustTerr11″ value=”” align=”middle” /></td>

<td class=cellTextGreyLeft><input type=”checkbox” name=”strCustTerr12″ value=”” align=”middle” /></td>

<td class=cellTextLeft><input type=”checkbox” name=”strCustTerr13″ value=”” align=”middle” /></td>

<td class=cellTextLeft><input type=”checkbox” name=”strCustTerr14″ value=”” align=”middle” /></td>

<td class=cellTextGreyLeft><input type=”checkbox” name=”strCustTerr15″ value=”” align=”middle” /></td>

<td class=cellTextGreyLeft><input type=”checkbox” name=”strCustTerr16″ value=”” align=”middle” /></td>

</tr>
</table>
</body>
</html>[/CODE]

class=cellTextGreyLeft just highlights the color.

to post a comment
HTML

4 Comments(s)

Copy linkTweet thisAlerts:
@claytonseoFeb 08.2010 — Use divs instead. you can give each div a width and height and you can place them anywhere you want.
Copy linkTweet thisAlerts:
@Major_PayneFeb 10.2010 — Set an id for 4,6,9th cells and use CSS. Nothing wrong with divs and CSS, but table tags are outdated, but, if used, are done better using CSS to lay them out.

Example CSS (between head tags):

<style type="text/css">

#four {

width: XXpx;

height: YYpx;

}

#six {

width: XXpx;

height: YYpx;

}

#nine {

width: XXpx;

height: YYpx;

}

</style>

Then the cells where you need this CSS:

<td id="four"> ... </td>

etc..

If they are all going to be ONE size, then you need a class for the cell:

td.special {

width: XXpx;

height: YYpx;

}

and each cell you change:

<td class="special"> ... </td>
Copy linkTweet thisAlerts:
@johnalexFeb 10.2010 — Hi,

Div based coding is better then table. However if you are even willing to use tables. You need to put table inside td and specify the width of the table that is inside td.
Copy linkTweet thisAlerts:
@martin_lawrenceFeb 12.2010 — > white-space:nowrap;

this keeps the text from wraping so if your text is longer then the

width it will overflow. ie. increase the containers width.

white-space:normal; is adviced
×

Success!

Help @cofactor spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 6.2,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @meenaratha,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,

tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,
)...