genzedu777 Posted November 3, 2010 Share Posted November 3, 2010 Hi, I have a question, i will like to align my words in the <td>. Currently the content skip to a new line, i will prefer it to be on just one line. Attached is the example. Is there a way to adjust the width? I have tried, but it didnt work. td { width: 300px; } Thanks [attachment deleted by admin] Link to comment https://forums.phpfreaks.com/topic/217623-regards/ Share on other sites More sharing options...
nano Posted November 3, 2010 Share Posted November 3, 2010 It's all about widths. Set a width on your table first, maybe to 100% so it stretches the width of your container. Then your td width can be a % of the table. So say td {width:50%;} etc Link to comment https://forums.phpfreaks.com/topic/217623-regards/#findComment-1129897 Share on other sites More sharing options...
genzedu777 Posted November 4, 2010 Author Share Posted November 4, 2010 Hi, Thanks for the info, it works now, it is align according to the box. However all the contents happen to be at the extreme left, I will like it to be aligned vertically as well. I have tried using positioning on <tr>, but it does not move at all. May I know did I miss out anything? Thanks #container { position: absolute; top: 110px; width: 920px; height: 2000px; border: solid 1px #CDCDCD; background: white; font-family: Arial, Verdana, Tahoma, Helvetica, sans-serif; font-size: 50%; } #container table { width: 100%; } #container tr { position: relative; left: 120px; } [attachment deleted by admin] Link to comment https://forums.phpfreaks.com/topic/217623-regards/#findComment-1130234 Share on other sites More sharing options...
nano Posted November 4, 2010 Share Posted November 4, 2010 Do you mean text-align? I would just add padding on the td cells. No need to play with positions. Have a look and see if padding solves your issue. Link to comment https://forums.phpfreaks.com/topic/217623-regards/#findComment-1130241 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.