Mysql Database - Need 3 equal columns

vinman64

I have the results of 3 columns coming from a mysql database. The columns have the correct information, however the column data is all crunched together as you can see at http://althedge.xyz/index2.html I have little knowledge of html and am trying to get the columns to spread out evenly across the page. Can anyone show me how to accomplish this? Thanks

Here is the code:

<?php

// Database Settings 
define('DB_HOST', 'localhost');
define('DB_PORT', '3306');
define('DB_USER', '*****');
define('DB_PASS', '*****');
define('DB_NAME', '*****');

// Connection to Database
$database = new MySQLi(DB_HOST, DB_USER, DB_PASS, DB_NAME, DB_PORT);

$sql = 'SELECT * '
        . ' FROM posts';

$resultSet = $database->query($sql);


// Begin building some HTML output

$html = '<table border="0">
<tr>
<th>Column1</th>
<th>Column2</th>
<th>Column3</th>
</tr>';

while ($row = $resultSet->fetch_assoc())
{
$html .= '<tr>';
$html .= '<td>' . $row['Column1'] . '</td>';
$html .= '<td>' . $row['Column2'] . '</td>';
$html .= '<td>' . $row['Column3'] . '</td>';
$html .= '</tr>';
}

$html .= '</table>';
echo $html;

?>
Moritz

Use

<table border="0" style="width: 100%;">

to make the table span the full width of the page. Note that the columns will still have different sizes.

To have all columns equally as well spaced you can use

<table border="0" style="width: 100%; table-layout: fixed;">

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

Bootstrap 3 Equal Height Columns with jQuery need assistance with the js

From Dev

Equal height columns bootstrap 3

From Dev

Dividing Array Into 3 Equal Columns

From Dev

Using MySQL to calculate difference of 2 columns to equal a 3rd column

From Dev

Need to Convert Columns into Rows in MYSQL

From Dev

MySQL query for delete row if two columns are equal

From Dev

MySQL query for delete row if two columns are equal

From Dev

MySQL Group By values that are equal over multiple columns

From Dev

Need to build table in 3 columns

From Dev

How to create a 5 equal columns in Bootstrap 3?

From Dev

Bootstrap 3 > trying to create columns with equal heights

From Dev

Issue with columns + carousel not equal in height in Bootstrap 3

From Dev

How to add 10 equal columns in the Bootstrap 3

From Dev

need to read excel sheet C# and import into mySQL only 3 columns

From Dev

Converting rows of MYSQL database into columns

From Dev

How to display results coming from database in 3 columns using php/mysql/html/css

From Dev

Creating MYSQL Database Table? Need Help Revising

From Dev

Need help displaying certain data in a MYSQL Database

From Dev

Creating MYSQL Database Table? Need Help Revising

From Dev

Getting started with MySQL, need help structuring a database

From Dev

Need to Join 3 Tables On Different Columns

From Dev

MySQL select rows where its columns sum equal value

From Dev

Find more than three columns having equal value in mysql

From Dev

MySQL select rows where its columns sum equal value

From Dev

MySQL query to get multiple columns to 3 columns

From Dev

Show text from rows in MySQL database equal 0 and 1?

From Dev

Bootstrap 3 Splitting col-md-9 into two equal columns

From Java

Flexbox grid with maximum 3 columns and minimum 2? With equal width items?

From Dev

Equal height columns with Bootstrap 3 while preserving column padding

Related Related

  1. 1

    Bootstrap 3 Equal Height Columns with jQuery need assistance with the js

  2. 2

    Equal height columns bootstrap 3

  3. 3

    Dividing Array Into 3 Equal Columns

  4. 4

    Using MySQL to calculate difference of 2 columns to equal a 3rd column

  5. 5

    Need to Convert Columns into Rows in MYSQL

  6. 6

    MySQL query for delete row if two columns are equal

  7. 7

    MySQL query for delete row if two columns are equal

  8. 8

    MySQL Group By values that are equal over multiple columns

  9. 9

    Need to build table in 3 columns

  10. 10

    How to create a 5 equal columns in Bootstrap 3?

  11. 11

    Bootstrap 3 > trying to create columns with equal heights

  12. 12

    Issue with columns + carousel not equal in height in Bootstrap 3

  13. 13

    How to add 10 equal columns in the Bootstrap 3

  14. 14

    need to read excel sheet C# and import into mySQL only 3 columns

  15. 15

    Converting rows of MYSQL database into columns

  16. 16

    How to display results coming from database in 3 columns using php/mysql/html/css

  17. 17

    Creating MYSQL Database Table? Need Help Revising

  18. 18

    Need help displaying certain data in a MYSQL Database

  19. 19

    Creating MYSQL Database Table? Need Help Revising

  20. 20

    Getting started with MySQL, need help structuring a database

  21. 21

    Need to Join 3 Tables On Different Columns

  22. 22

    MySQL select rows where its columns sum equal value

  23. 23

    Find more than three columns having equal value in mysql

  24. 24

    MySQL select rows where its columns sum equal value

  25. 25

    MySQL query to get multiple columns to 3 columns

  26. 26

    Show text from rows in MySQL database equal 0 and 1?

  27. 27

    Bootstrap 3 Splitting col-md-9 into two equal columns

  28. 28

    Flexbox grid with maximum 3 columns and minimum 2? With equal width items?

  29. 29

    Equal height columns with Bootstrap 3 while preserving column padding

HotTag

Archive