Solved

Align tablecell controls

Posted on 2007-03-27
3
1,218 Views
Last Modified: 2008-01-09
Hi experts.

Does anyone know how to align tablecell controls horizontally using .net (VB)? i have a table cell containing two controls : a time picker and a date picker (could not find a composite control?) and would like them to appear side by side in the cell.  Would prefer not to create another table column for appearance sake and there does not seem to be a way to split a cell?

Many thanks
0
Comment
Question by:jeanniex
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 3

Expert Comment

by:Saber37886661
ID: 18805328
you can try and set the table cells HorizontalAlign to HorizontalAlign.Center.
It will probably not put them side to side though, so likely you will have to wrap them in another table, but if the tables border, cellpadding and cellspacing is set to '0' then the table is not visible and it will not affect your layout.

Hope it helps
0
 
LVL 1

Author Comment

by:jeanniex
ID: 18807474
Hi.

The horizontal alignment option does not work - nor combining this with "wrap" = false.
If I put another table in the cell and add a row to this with two cells - putting one control in each, they do appear side by side but not aligned horizontally.  Modifying the horizontalalignment of these tablecells does not seem to have the desired result either.
I am doing this in VB and not in the design view as I need to be able to add rows dynamically.
Any ideas?
thanks in advance
0
 
LVL 3

Accepted Solution

by:
Saber37886661 earned 500 total points
ID: 18809466
If it helps, I always do mine in the editor/ code view and never the design mode, lol it always crashes my copy of visual studio! (even after the 255th re-install)
for me i just go:
Dim tab As New Table
Dim tr As New TableRow
Dim tc As New TableCell
tc.HorizontalAlign = HorizontalAlign.Center

but normally in c# (its alot easier in c#, the language structure is more logical(wait for the comments on that comment of mine!))

ok how about giving the table cells a CssClass, eg:
tc.CssClass() = "tdAlign"
then in your css just add
.tdAlign
{
     white-space:normal;
     text-align: center;
}
or you could add it to the top of your page.
<style>
.tdAlign
{
     white-space:normal;
     text-align: center;
}
</style>

if none of this helps, let me know, but for now, its bed time
0

Featured Post

Guide to Performance: Optimization & Monitoring

Nowadays, monitoring is a mixture of tools, systems, and codes—making it a very complex process. And with this complexity, comes variables for failure. Get DZone’s new Guide to Performance to learn how to proactively find these variables and solve them before a disruption occurs.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
One object/table or two? - Loan/Return model (ASP.NET MVC 5) 4 106
How to handle PHP $_POST requests 4 69
Search on a site 5 135
Where can I find... 1 53
Introduction (All good things must come to an end (http://en.wikipedia.org/wiki/All_Good_Things...))The original MySQL API (http://php.net/manual/en/book.mysql.php) has gone away, deprecated by PHP in Version 5.5, and removed from PHP in all current…
Introduction A frequently used term in Object-Oriented design is "SOLID" which is a mnemonic acronym that covers five principles of OO design.  These principles do not stand alone; there is interplay among them.  And they are not laws, merely princ…
This video teaches users how to migrate an existing Wordpress website to a new domain.
Use Wufoo, an online form creation tool, to make powerful forms. Learn how to choose which pages of your form are visible to your users based on their inputs. The page rules feature provides you with an opportunity to create if:then statements for y…

726 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question