473,408 Members | 2,734 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,408 software developers and data experts.

layout within <td>

How can I get the following to appear on just 1 line?

<style type="text/css">
#center { text-align: center;}
#left { text-align: left;}
#right {text-align: right}
</style>

<table border=1 width=200>
<tr>
<td>
<div id="left">left
<div id="center">center
<div id="right">right
</td>
</tr>
</table>

I tried using "display:inline" and play with "float" property but
couldn't get it to work right.
Thanks!

Radek

Jul 21 '05 #1
3 3644
On 10 May 2005 08:14:39 -0700, "Radek" <ra*********@firstlogic.com>
wrote:
How can I get the following to appear on just 1 line?


You want to be spoonfed?

Note that it is highly recommended to stay away from pixel sized
elements in a real design.

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<HTML>
<HEAD>
<TITLE>Your own title here</TITLE>
<style type="text/css">
body {
margin: 0; border: none; padding: 0;
font-size: 100%;
}
table {
margin: 0; padding: 0;
border: solid 1px #000000;
}
td {
margin: 0; border: none; padding: 0;
width: 210px;
}
.left {
margin: 0; border: none; padding: 0;
text-align: left; width: 70px; float: left;
}
.center {
margin: 0; border: none; padding: 0;
text-align: center; width: 70px; float: left;
}
.right {
margin: 0; border: none; padding: 0;
text-align: right; width: 70px; float: left;
}
</style>
</HEAD>
<BODY>
<table>
<tr>
<td>
<div class="left">left</DIV>
<div class="center">center</DIV>
<div class="right">right</DIV>
</td>
</tr>
</table>
</BODY>
</HTML>

--
Rex
Jul 21 '05 #2
*Radek*:
<tr><td>
<div id="left">left
<div id="center">center
<div id="right">right
</td></tr>


Any reason for not using three distinct table cells (or for not closing
your 'div' elements)?
Jul 21 '05 #3
Thanks for your help! Not closing the <div> elements was my mistake
(sorry). Putting everything in 3 different table cells that's
unfortunately is not an option. I'd also want to stay away from
hardcoding the pixel sizes. I'd be happy with the output that I'm
getting in my original example if everything was simply on 1 line (I
though that's what "display:inline" was supposed to do but that doesn't
seem to be the case).

Jul 21 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Matt Adams | last post by:
I want to move the following <PRE> defintion to a css file: <TABLE><TR><TD><PRE>sample text</PRE></TD> <TD> not predefined font</TD></TR></TABLE> should be <TABLE><TR><TD class=aaa>sample...
2
by: js | last post by:
I have a table rendered with XSLT. The first column has a radio button controls for user to make a selection for a particular row. All the values in the remaining columns are all concated with a...
2
by: bissatch | last post by:
Hi, I am trying to use JavaScript to write a table column on a web page. The code is as follows: <html> <head> <script> function displaycount() {
3
by: RC | last post by:
I have a very sime html table like <html><head><title>My Table</title> <style> input { margin: 0; padding: 0; border-width: 0; text-indet: 0; text-align: left } </style></head><body> <table...
1
by: prefersgolfing | last post by:
I'm not using Master Pages, yet I'd like to display the contents of an HTML page within a <table><tr><td> on a .aspx. I have a lengthy guide already paginated in html. I'd like to embed the...
5
by: mahesr | last post by:
I want to match some particular text between <tr>and </tr> or <td>and </td>.... in PHP. like below............ <table><tr> CATEGORY: <td><font face="Verdana" size="1" color="#A000A0"> Wedding...
4
George Lft
by: George Lft | last post by:
I'm new at building table. Mostly PHP programming . Now I can't seem to fix the size of my table row and column. Any idea? <h4>Two rows and three columns:</h4> <table border="1"> <tr> ...
1
by: test9991014 | last post by:
Hi folks, I've got something like this: <table> <tr> <td>1</td> <td align=center> <input type=text> </td>
7
by: Xiaoyan | last post by:
Hi,everyone: I have a problem now. I can't get the information between the <tr><td> and </td></tr>. for example: I use this regular expression can't get it, I don't know why....
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.