hi to all..
is it possible to make a table beside another table?
because when i am making 2 tables, the second one is placed under the 1st one..
for example: *# represents the table*
~ i want this to happen
# #
but this is what happens
#
#
9 1608
Its simplest to show you,
but briefly, enclose each table in a floating div that has a width set to 50% and a min-width set to insure against a too small window.
In this example the divs have a class: .floatdiv{position:relative;min-width:400px;width:50%;float:left} - <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN">
-
<html lang="en">
-
<head>
-
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
-
<title>HTML Table Floats</title>
-
-
<style type="text/css">
-
table{border:ridge black 3px;background-color:white;font-size:1em;width:90%}
-
td,th{border:solid black 1px;padding:2px}
-
.sortableClass th{cursor:pointer}
-
thead,tfoot{background-color:#eee;font-size:1.1em;font-weight:bold;text-align:center}
-
.floatdiv{position:relative;min-width:400px;width:50%;float:left}
-
</style>
-
-
-
</head>
-
-
<body>
-
<h1>HTML Elements</h1>
-
-
<div class="floatdiv">
-
<table>
-
<caption>Three Column Table</caption>
-
<thead class="sortableClass">
-
<tr><th>Make</th><th>Model</th><th>Price</th></tr>
-
</thead>
-
<tbody>
-
<tr><td>Ford</td><td>Truck</td><td>$23,000</td></tr>
-
<tr><td>Subaru</td><td>Wagon</td><td>$21,000</td></tr>
-
<tr><td>Kia</td><td>Compact</td><td>$13,000</td></tr>
-
<tr><td>Lexus</td><td>Sedan</td><td>$35,000</td></tr>
-
<tr><td>Honda</td><td>SUV</td><td>$26,000</td></tr>
-
-
</tbody>
-
</table>
-
</div>
-
<div class="floatdiv">
-
<table>
-
<caption>Three Column Table</caption>
-
<thead class="sortableClass">
-
<tr><th>Make</th><th>Model</th><th>Price</th></tr>
-
</thead>
-
<tbody>
-
<tr><td>Ford</td><td>Truck</td><td>$23,000</td></tr>
-
<tr><td>Subaru</td><td>Wagon</td><td>$21,000</td></tr>
-
<tr><td>Kia</td><td>Compact</td><td>$13,000</td></tr>
-
<tr><td>Lexus</td><td>Sedan</td><td>$35,000</td></tr>
-
<tr><td>Honda</td><td>SUV</td><td>$26,000</td></tr>
-
-
</tbody>
-
</table>
-
</div>
-
-
</body>
-
</html>
thanks for the reply!!
i'll try this when i get home and inform you with the result..
thanks again!!
i have already tried the code you've given me..
but the 2nd table is still under the 1st table,
what i want is for the 2nd table to be beside of the 1st table..
is what i want possible?
Hi Mirian,
try this,
[HTML]<body>
<table align="left"><tr><td>Table 1, Row 1, Cell 1</td></tr></table>
<table><tr><td>Table 2, Row 1, Cell 1</td></tr></table>
</body>[/HTML]
Try this.
[HTML] <html>
<head>
<style type="text/css">
#table {
float:left;
display:inline;
}
</style>
</head>
<body>
<table id="table">
<tr>
<td>
Text
</td>
</tr>
</table>
<table>
<tr>
<td>
Text
</td>
</tr>
</table>
</body>
</html>
[/HTML]
^_^ Hope it helps, Thanks, Death
hi to all..
is it possible to make a table beside another table?
because when i am making 2 tables, the second one is placed under the 1st one..
for example: *# represents the table*
~ i want this to happen
# #
but this is what happens
#
#
Hi Buddy !
Its pretty simple.. all you have to do is to align both the tables to left ... ie - <table align = "left">
-
<tr>
-
<td>Here is the 1st table</td>
-
</tr>
-
</table>
-
-
<table align = "left">
-
<tr>
-
<td>Here is the 2nd table</td>
-
</tr>
-
</table>
Hi Mirian,
try this,
[HTML]<body>
<table align="left"><tr><td>Table 1, Row 1, Cell 1</td></tr></table>
<table><tr><td>Table 2, Row 1, Cell 1</td></tr></table>
</body>[/HTML]
Try this.
[HTML] <html>
<head>
<style type="text/css">
#table {
float:left;
display:inline;
}
</style>
</head>
<body>
<table id="table">
<tr>
<td>
Text
</td>
</tr>
</table>
<table>
<tr>
<td>
Text
</td>
</tr>
</table>
</body>
</html>
[/HTML]
^_^ Hope it helps, Thanks, Death
hey, thanks for helping me!!
big help!!
Hi Buddy !
Its pretty simple.. all you have to do is to align both the tables to left ... ie - <table align = "left">
-
<tr>
-
<td>Here is the 1st table</td>
-
</tr>
-
</table>
-
-
<table align = "left">
-
<tr>
-
<td>Here is the 2nd table</td>
-
</tr>
-
</table>
thank you also for helping..
that (align = "left") was my problem.. hehe..
stupid me..
No problem. I would just like to point out that using the 'align' attribute isn't valid (unless you're using a transitional doctype), and that you should use CSS instead.
^_^ Thanks, Death
Sign in to post your reply or Sign up for a free account.
Similar topics
by: SteveJ |
last post by:
All,
Can someone help me solve the next step.
First of all let me say I'm new to php. I pieced the following code together
from samples
I found on the net and a book I bought called PHP...
|
by: john T |
last post by:
Is there anyway to vertically center a html table using css in such a
way it does not alter the html table. When I tryied it just screws up.
|
by: Peter Kirk |
last post by:
Hi there
can someone please help me with creating dynamic content in a table? For
example, see the below javascript and html - why is a new row not created in
the table when I click the button?...
|
by: Guadala Harry |
last post by:
In an ASCX, I have a Literal control into which I inject a
at runtime.
litInjectedContent.Text = dataClass.GetHTMLSnippetFromDB(someID);
This works great as long as the contains just...
|
by: Andrew |
last post by:
Hi, friends,
In ASP, we use
obj = CreateObject("com.dll")
obj.GetHTMLText(inVal, outHTMLTxt1, outHTMLTxt2)
to get different HTML strings based on input values.
Then, we insert them into...
|
by: since |
last post by:
I figured I would post my solution to the following.
Resizable column tables.
Search and replace values in a table. (IE only)
Scrollable tables.
Sortable tables.
It is based on a lot...
|
by: lynx129 |
last post by:
Hi there ,
I have php script that works fine under my server
but I dont know how to put the html code inside my site.
feedback.html
<html dir="rtl">
<head>
<title> ????? ??? </title>...
|
by: imtmub |
last post by:
I have a page, Head tag Contains many Scripts and style sheet for Menu and Page. This code working fine and displaying menus and page as i wanted.
Check this page for reference....
|
by: sateeshchandrasanga |
last post by:
Hi All,
My HTML code is working fine in Firefox.But its not displaying any thing in IE.Can you help me in this problem.And in Google crown its displaying but not properly.
...
|
by: happyse27 |
last post by:
Hi All,
I got this apache errors(see section A1 and A2 below) when I used a html(see section b below) to activate acctman.pl(see section c below). Section D below is part of the configuration...
|
by: taylorcarr |
last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
by: ryjfgjl |
last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
|
by: emmanuelkatto |
last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud.
Please let me know.
Thanks!
Emmanuel
|
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...
|
by: Sonnysonu |
last post by:
This is the data of csv file
1 2 3
1 2 3
1 2 3
1 2 3
2 3
2 3
3
the lengths should be different i have to store the data by column-wise with in the specific length.
suppose the i have to...
|
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...
|
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,...
|
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...
| |