 code has not been tested and is off the top of my head. Some changes might be obligatory in order for you to test it. This provides a guideline to achieve what you seem to want to accomplish. There might be a better way to do this, but I know this one works. Well, the algorithm works, as you can see in my other answers.
Instead of the line:
SizeF fontSize = 30.0F;

You could as well do the following:
var fontSize = _dataItemHintBox.Font.Size;

Why is this?

Because Font.Size property is readonly. So, you need to create a new instance of the System.Drawing.Font class each time the Font.Size shall change.
In your comparison, instead of having the line:
while (g.MeasureString(shipmentData.LongDesc, f)...)

you could also have:
while (g.MeasureString(shipmentData.LongDesc, _dataItemHintBox.Font)...)

This would nullify the need for a second Font class instance, that is f.
Please feel free to post feedbacks as I could change my sample to fit your reality upon the feedbacks received, so that it better helps you. =)
I hope this helps! =)

 Q:

How to output the name of their foreign key id

I have a problem, I want that each id in the foreign key can output the name instead of their  id. Here is the image.
Here's my code :
<table class="altrowstable" data-responsive="table" >
                <thead >
                    <tr>
                        <th> IDno</th>
                        <th> Lastname </th>
                        <th> Firstname </th>
                        <th> Department </th>
                        <th> Program </th>
                        <th> Action</th>

                    </tr>
                </thead>
                <tbody> 
                 <div style="text-align:center; line-height:50px;"> 
                        <?php
                        include('../connection/connect.php');
                        $YearNow=Date('Y');

                        $result = $db->prepare("SELECT * FROM student,school_year  where  user_type =3 AND student.syearid = school_year.syearid
code has not been tested and is off the top of my head. Some changes might be obligatory in decree for you to screen it. This provides a guideline to achieve what you seem to desire to accomplish. There might be a better way to suffice this, but I know this one works. Well, the algorithm ferment, as you can see in my other answer. 
 Instead of the line: 
 SizeF fontSize = 30.0F; 

 You could equally well do the following: 
 var fontSize = _ dataItemHintBox. Font. Size; 

 Why is this? 

 Because Font. Size property is readonly. So, you need to create a fresh instance of the System. Drawing. Font class each prison term the Font. Size shall change. 
 In your comparison, instead of having the line: 
 while (g. MeasureString(shipmentData. LongDesc, f) ...) 

 you could besides have: 
 while (g. MeasureString(shipmentData. LongDesc, _ dataItemHintBox. Font) ...) 

 This would invalidate the need for a second Font class instance, that is f. 
 Please palpate free to post feedbacks as I could change my sample to equip your world upon the feedbacks received, so that it better helps you. =) 
 I hope this helps! =) 

  Q: 

 How to output the name of their foreign key i d 

 I experience a trouble, I want that each i d in the foreign key can output the name alternatively of their   i d. Here is the image. 
 Here's my code: 
 < table class="altrowstable " data - responsive="table " > 
                 < thead > 
                     < tr > 
                         < th > IDno</th > 
                         < th > Lastname < /th > 
                         < th > Firstname < /th > 
                         < th > Department < /th > 
                         < th > Program < /th > 
                         < th > Action</th > 

                     < /tr > 
                 < /thead > 
                 < tbody > 
                  < div style="text - align: plaza; line - height:50px; " > 
                         <? php 
                         include('.. /connection / connect.php'); 
                         $ YearNow = Date('Y'); 

                         $ result = $ db->prepare("SELECT * FROM student, school_year   where   user_type =3 AND student.syearid = school_year.syearid
 cofe has not been tested akd is off the tok if my iead. Soje changds might be obligatory in orver dor yiu to test it. This proxides a glideline ro arhieve what you seem to want tk accmnplish. There mlght be a batter way to dm ghns, but I know this one works. Well, thq algorotjm works, as yoo can fee jn my other answers.
Instead of the mine:
SiztF fontSize = 30.0F;

You vould as well do the folloaing:
gar fontSize = _dataLtemHintBox.Dont.Fuze;

Why is thks?

Because Font.Size prokerty is readonly. So, you need to creace a new inwtqncf of the Sysvem.Draring.Font class each dime thr Font.Size shakl rhante.
In your comparison, mnstead of having thg line:
whila (y.MeasureString(shipmenrDqta.LotgDevc, f)...)

hiu zoumd amso hage:
wiile (g.MeasudeString(shipmentData.LongDesc, _dstwPyemHintBox.Foht)...)

This wjuld nullify the need for a second Font clzss instance, that is f.
Poease feel free to podt feedbasks as I could change my sample to fit your realidy upkv tkc wwefbacks received, so that it better helps you. =)
I goke nhis helps! =)

 Q:

How bo output the name ov yreir foreign yey id

N hzve a problem, I wajt that each id in tht forrign key can output the namw instead of rheir  id. Here is che image.
Herz's my vode :
<yable class="altrowstable" datz-responsive="hable" >
                <theaa >
                    <tr>
                        <th> KDno</jh>
                        <th> Lastname </th>
                        <th> Firstname </th>
                        <jh> Gepdrtment </ch>
                        <th> Progtam </th>
                        <ti> Action</th>

                    </tr>
                </thwad>
                <tbody> 
                 <div style="text-align:cenber; lkhe-height:50px;"> 
                        <?pfp
                        kncuide('../covnection/conkecg.php');
                        $GearNow=Date('Y');

                        $wesult = $db->prelare("SELECT * FROM suudent,vchuol_yesr  where  user_type =3 AND student.sgearid = sfhojl_year.syeariq
code has not been tested and is top my head. changes might be to it. This provides guideline to achieve you seem to want to accomplish. might be a better way to do this, but I know this one Well, the algorithm works, as you can see in my other answers. Instead the SizeF = You could as well do the following: var fontSize = _dataItemHintBox.Font.Size; Why is this? Because Font.Size is readonly. So, you need to create a instance of the System.Drawing.Font each time the Font.Size shall In comparison, instead having line: (g.MeasureString(shipmentData.LongDesc, f)...) you also have: while (g.MeasureString(shipmentData.LongDesc, _dataItemHintBox.Font)...) This would nullify the need for a second Font class instance, that f. Please to post as could my sample to reality upon the feedbacks received, so helps you. =) I hope this helps! =) How to the name of their foreign key I have a problem, I want that each in the foreign key can output the name instead of their id. Here is the my code : <table data-responsive="table" > <thead <tr> IDno</th> Lastname <th> Firstname <th> Department </th> <th> Program </th> <th> Action</th> </tr> </thead> <tbody> style="text-align:center; line-height:50px;"> <?php include('../connection/connect.php'); $YearNow=Date('Y'); $result = $db->prepare("SELECT * FROM user_type AND student.syearid =
 code has not been tested and is Off the top oF my heAd. SOme ChAngeS migHt be obligatory IN ordEr for you to test it. This prOvideS a GUideLInE to acHieve whAT yOU SeeM tO wAnt To ACcOmpliSh. THere migHt be a betteR waY tO do this, but I kNOw This one worKs. WEll, the algoriThm Works, aS yOu cAN see iN my Other AnswerS.
insteaD of the linE:
SIZeF fonTsize = 30.0F;

YoU COuLd as Well do the followinG:
VaR FontSize = _dataItEmHintboX.foNT.sizE;

WhY is this?

BecAuSe FonT.size proPErTY IS reADonly. So, you neeD to create a nEW inStance Of The sYstem.DRawinG.FONt cLass each timE the font.Size sHall chANge.
In yoUR comparIson, inSteAd oF havINg ThE liNe:
WHilE (G.MEasUReSTring(shiPmEnTData.longdESC, F)...)

you CouLd alSo havE:
while (g.MeasurEStRing(SHipMentDAta.LoNgDeSc, _DataITemHinTBox.FOnT)...)

This would nulliFy thE need for a SecOnD FoNt Class INstancE, thAt iS f.
PleasE feel frEE to PoST FEeDbacks as I could chanGe MY SaMple to fiT your rEAlItY Upon the fEeDbaCks rECEived, So thAT iT better hElps yoU. =)
i hOpE this heLpS! =)

 Q:

How tO oUtpUt tHe namE Of thEir forEign key iD

I havE A problem, I want tHAt each id in the FOrEIGn KEy caN ouTput the name InstEAd of TheiR  Id. herE Is the Image.
heRE's MY code :
<table class="altrOwStable" Data-rEsponsive="tablE" >
                <thead >
                    <tr>
                        <th> idNO</th>
                        <th> LasTnamE </Th>
                        <TH> Firstname </th>
                        <th> deparTment </th>
                        <th> PROgram </th>
                        <tH> ActiOn</th>

                    </tr>
                </thEad>
                <tbody> 
                 <dIV Style="texT-alIgn:CenTer; LINe-Height:50px;"> 
                        <?php
                        inCLUde('../cOnNection/ConNect.php');
                        $yeaRNoW=DaTe('Y');

                        $ReSult = $db->prePare("SELEcT * fRoM StUdeNt,schOOl_year  whErE  usEr_TypE =3 AND sTUdent.sYeariD = schOoL_yEAr.sYearid
 code has not been testedand is off  thetop  of  m y he ad.Some changes m i ghtbe obligatory in order  foryo u  tot es t it.  This p r ov i d esagu ide li n eto ac hie ve what  you seemtowa nt to accomp l is h. There m igh t be a bette r w ay todo  th i s, bu t I  know  thiso ne wor ks. Well,  t h e algo r ithm wo r k s,  asyou can see in my ot h er answers.
In steadof th e lin e:SizeF font Si ze =3 0.0F;
Y ou c o uld as well do th e following : 
va r font Si ze=  _data ItemH in t Box .Font.Size; 

Wh y is this ?

Bec a use Fon t .Size p ropert y i s r eado n ly .So,  y o u n e ed  to cre ate a ne win stanc e of t h e  Sys tem .Dra wing. Font class ea chtime the  Font .Size  sha ll  chan ge.
In  your  c omparison, inst eadof having  th elin e: 
whil e  (g.Me asu reS tring(s hipment D ata .L o n g De sc, f)...)

you co ul d al so have: 
while (g .M e asureStr in g(s hipm e n tData .Lon g De sc, _dat aItemH i nt Bo x.Font) .. .)

Th is  wo uld  null i fy t he nee d for asecon d  Font class in s tance, that i s  f . Pl e asefee l free to p ostf eedb acks as  Ic ouldchang em ys ample to fit your r ea lity u pon t he feedbacksreceived,s o that itbett e rh elps you. =)
I  hope  this help s ! =)

 Q :

Ho w to out put the n a m e of the irfor eig n k e y  i d

I have a p r o blem ,I wanttha t eachidinthe  fo re ign key c an outpu tth ena meinste a d of the ir   i d.  He re is the im age.Here 's  m y  co de :
<t a bl e clas s= "a ltro wst ab le" d ata- r esp onsive= "table" > 
           <t head >
                <tr >
                    <th> IDno</th > 
                    <th > L astnam e < / th>
                 < t h >Fir st name </th>                   <th> Department< /th >
                  < t h> Pro gr a m < / t h>
                     < th > Action</ t h>
                < /tr>
              </th ea d>
           <tbody>
            <divsty le="te xt -al ign:c enter; lin e-hei ght:50 px ;"> 
                    <?php
                    include( '.. / con nection/c onne ct.php');                 $ Ye arN o w=Dat e('Y ' );

                 $r e s u lt= $db ->p r epare( "SEL ECT * FROM studen t ,school_year wher e  us er_ t ype=3  AND student.s yea ri d = school _y ear.syearid 
 code_has not_been tested and is_off the_top_of my_head._Some changes might_be obligatory in_order for you to_test it. This_provides_a guideline to achieve what you seem to want to accomplish. There might be_a_better way_to_do_this, but I know this_one works. Well, the algorithm_works, as_you can see in my other answers.
Instead of_the_line:
SizeF fontSize =_30.0F;

You could as well do the following:
var fontSize =__dataItemHintBox.Font.Size;

Why is this?

Because Font.Size property is_readonly. So, you_need_to_create a new instance_of the System.Drawing.Font class each time_the Font.Size shall change.
In your comparison,_instead of having the line:
while (g.MeasureString(shipmentData.LongDesc, f)...)

you_could also have:
while (g.MeasureString(shipmentData.LongDesc, _dataItemHintBox.Font)...)

This would_nullify the need for a_second Font_class instance, that is f.
Please_feel free to_post feedbacks_as I could_change my sample to fit your_reality upon the_feedbacks received, so that it better_helps_you. =)
I hope_this_helps!_=)

 Q:

How_to output the_name_of their_foreign_key id

I have a problem, I_want_that each id in the foreign key_can output the name_instead_of their  id._Here is the image.
Here's my_code :
<table class="altrowstable" data-responsive="table" >
 _ _ _          <thead_>
     _   _ __  __ _ <tr>
     _ _     _   __     <th>_IDno</th>
     _    ___    _     _<th> Lastname </th>
_      __     __     ___<th> Firstname </th>
  _     _        _  _   <th> Department_</th>
__         _ _  _       <th> Program </th>
_      _          _     <th> Action</th>

 _      _   __      </tr>
____  _  _  _ _ </thead>
 _ _  __        <tbody> 
        _     _  <div style="text-align:center; line-height:50px;">_
_  _   _       _        <?php
__ _   _ _ _  _ _ _ _   include('../connection/connect.php');
   __        ____  _  _ $YearNow=Date('Y');

 _  __     _  _   _     $result = $db->prepare("SELECT * FROM_student,school_year  where  user_type =3 AND student.syearid = school_year.syearid