AmitDiwan has Published 10744 Articles

Styling Tables with CSS

AmitDiwan

AmitDiwan

Updated on 30-Dec-2019 09:36:57

244 Views

For styling the tables with CSS, we can set borders, collapse, set width and height. We can also set the padding, alig text in it, etc. Let us see some examples −ExampleTo add borders to a table in CSS, use the borders property. Let us now see an example − Live ... Read More

jQuery height() with Examples

AmitDiwan

AmitDiwan

Updated on 30-Dec-2019 09:19:31

186 Views

The height() method in jQuery is used to set or return the height of the selected elements. It does not include padding, border, or margin.SyntaxThe syntax is as follows −$(selector).height() $(selector).height(val)Above, Val in the 2nd syntax is used to specify the height in px, em, pt, etc.ExampleLet us now see ... Read More

jQuery outerWidth() Method

AmitDiwan

AmitDiwan

Updated on 30-Dec-2019 09:16:28

182 Views

The outerWidth() method in jQuery is used to return the width of an element. The method includes padding and border.OutputThe syntax is as follows−$(selector).outerWidth(margin)Above, the margin is a Boolean value to specify whether or not to include the margin. TRUE is to include the margin.ExampleLet us now see an example ... Read More

jQuery outerHeight() Method

AmitDiwan

AmitDiwan

Updated on 30-Dec-2019 09:13:20

227 Views

The outerHeight() method in jQuery is used to return the height of an element. The method includes padding and border.SyntaxThe syntax is as follows−$(selector).outerHeight(margin)Above, the margin is a Boolean value to specify whether or not to include the margin. TRUE is to include the margin.ExampleLet us now see an example ... Read More

jQuery Misc param() Method

AmitDiwan

AmitDiwan

Updated on 30-Dec-2019 08:17:43

155 Views

The param() method in jQuery is used to create a serialized representation of an array or object.SyntaxThe syntax is as follows −$.param(obj, val)Above, obj is the object to serialize, whereas Val specifies whether or not to use the traditional style of param serialization.ExampleLet us now see an example to implement ... Read More

jQuery last() with Examples

AmitDiwan

AmitDiwan

Updated on 30-Dec-2019 08:07:52

200 Views

The last() method in jQuery is used to return the last element of the selected elements.SyntaxThe syntax is as follows −$(selector).last()ExampleLet us now see an example to implement the jQuery last() method − Live Demo    $(document).ready(function(){       $("div p").last().css("color", "orange");    }); ... Read More

Return the field with highest count in MySQL

AmitDiwan

AmitDiwan

Updated on 30-Dec-2019 08:02:13

2K+ Views

To return the field with highest count, use ORDER BY COUNT(*). Let us first create a table −mysql> create table DemoTable1940    (    FirstName varchar(20)    ); Query OK, 0 rows affected (0.00 sec)Insert some records in the table using insert command −mysql> insert into DemoTable1940 values('Chris'); Query OK, ... Read More

MySQL query to select everything to left of last space in a column with name records

AmitDiwan

AmitDiwan

Updated on 30-Dec-2019 07:58:21

269 Views

For this, you can use LEFT(). Let us first create a table −mysql> create table DemoTable1939    (    FullName varchar(20)    ); Query OK, 0 rows affected (0.00 sec)Insert some records in the table using insert command −mysql> insert into DemoTable1939 values('Adam Smith'); Query OK, 1 row affected (0.00 ... Read More

Display all fields of a table in MySQL?

AmitDiwan

AmitDiwan

Updated on 30-Dec-2019 07:56:20

1K+ Views

To display all fields, set the database with table_schema and specific table with table_name as in the below syntax −select column_name as anyAliasName from information_schema.columns    where table_schema=database()    and table_name=’yourTableName’\GLet us first create a table −mysql> create table DemoTable1938    (    StudentId int,    StudentName varchar(20),    StudentAge ... Read More

MySQL ORDER BY ASC and display NULLs at the bottom?

AmitDiwan

AmitDiwan

Updated on 30-Dec-2019 07:54:41

548 Views

For this, use CASE statement with ORDER BY. Let us first create a table −mysql> create table DemoTable1937    (    Name varchar(20)    ); Query OK, 0 rows affected (0.00 sec)Insert some records in the table using insert command −mysql> insert into DemoTable1937 values('Chris'); Query OK, 1 row affected ... Read More

Advertisements